package cn.wolfcode.luowowo.advice;

import cn.wolfcode.luowowo.common.CommonExceptionAdvice;
import cn.wolfcode.luowowo.common.Result;
import cn.wolfcode.luowowo.msg.MsgCodeMsg;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by wolfcode-lanxw
 */
@ControllerAdvice
public class MsgControllerAdvice extends CommonExceptionAdvice {
    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result handleDefaultException(Exception e){
        e.getMessage();
        return Result.error(MsgCodeMsg.DEFAULT_ERROR);
    }
}
